package com.fansl.allround.upms.api.feign;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/7/11 18:38
 */

import com.fansl.allround.common.core.constant.SecurityConstants;
import com.fansl.allround.common.core.constant.ServiceNameConstants;
import com.fansl.allround.common.core.util.R;
import com.fansl.allround.upms.api.entity.SysLog;
import com.fansl.allround.upms.api.feign.factory.RemoteLogServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteLogService",value = ServiceNameConstants.UMPS_SERVICE,fallbackFactory = RemoteLogServiceFallbackFactory.class)
public interface RemoteLogService {
    /**
     * 保存日志
     * @param sysLog 日志实体
     * @param from 内部调用标志
     * @return
     */
    @PostMapping("/log")
    R<Boolean> saveLog(@RequestBody SysLog sysLog, @RequestHeader(SecurityConstants.FROM)String from);
}
